If isc-dhcp gets restarted, it might have to deal with RFC-1918 zones
being previously populated by an earlier instance. In that case, we
need to know if we're modified versus initially adding the zones.
The special handling of RFC-1918 zones in Bind is quirky, and there
should be a patch soon to make it more friendly, but in the meantime
you might have to use:
disable-empty-zone 168.192.in-addr.arpa;
Or similar depending on which address block you poach.
Signed-off-by: Philip Prindeville <[email protected]>
UPSTREAM_NAME:=dhcp
PKG_REALVERSION:=4.4.3-P1
PKG_VERSION:=4.4.3_p1
-PKG_RELEASE:=13
+PKG_RELEASE:=14
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
}
create_empty_zone() {
- local zone error zpath
+ local zone error zpath command
zone="$1"
zpath="$dyndir/db.$zone"
chown bind:bind "$zpath" || return 1
chmod 0664 "$zpath" || return 1
- if ! error=$(rndc modzone $zone "{
+ # if the zone doesn't exist, we need to add it, otherwise we need to
+ # create it.
+ if ! rndc zonestatus $zone >/dev/null 2>&1; then
+ command="addzone"
+ else
+ command="modzone"
+ fi
+
+ if ! error=$(rndc $command $zone "{
type primary;
file \"$zpath\";
update-policy {